﻿using System;
using System.Windows.Forms;
using AutomaTones.Controller;
using Microsoft.Pex.Framework;

namespace AutomaTones
{
    [PexClass]
    partial class Program
    {
        /** Bad performance of graphics. Found the following hack on 
         * http://www.devnewsgroups.net/windowsforms/t50851-slow-drawing-speed-winforms-esp-via-com-interop-solved.aspx
         */
        private static bool m_VisualStylesHaveBeenSet;

        [PexMethod]
        public static void SetVisualStyles() {
            if (!m_VisualStylesHaveBeenSet) {
                Application.EnableVisualStyles();
                Application.SetCompatibleTextRenderingDefault(false);
                m_VisualStylesHaveBeenSet = true;
            }
        }
        [PexMethod(MaxBranches = 100000)]
        [STAThread]
        internal static void Main(string[] args){
            MainController _mainController = new MainController();
            _mainController.Init();
            SetVisualStyles();
            Application.Run(new GuiView(_mainController));
            new GuiView(_mainController);
        }
    }
}
